<?php
namespace App\Controller\Admin;

use App\Query\UserIntegralQuery;
use App\Repository\UserIntegralRepository;

use App\Job\UserMinRedJob;

class UserIntegralController extends Controller
{
    // 列表
    public function index()
    {
        return UserIntegralQuery::query(
            UserIntegralQuery::model(),
            $this->inputs('user_id', 'status', 'phone')
        )->paginate(15)->toArray();
    }
    
    // 重试
    public function reboot($id)
    {
        if($model = UserIntegralRepository::find($id))
        {
            if($model->reboot())
            {
                $this->message('ok');
            }
        }
        
        $this->error('error');
    }
}